package com.jsyso.weixin.msg;

/**
 * 消息基类
 * @author janjan, xujian_jason@163.com
 *
 */
public abstract class Msg {
	protected String toUserName;		// 【in】开发者微信号，【out】接收方帐号（openid）
	protected String fromUserName;		// 【in】发送方帐号（openid），【out】开发者微信号
	protected Integer createTime;		// 消息创建时间 （整型）
	protected MsgType msgType;			// 消息类型

	public Msg() {}
	
    protected Msg(String toUserName, String fromUserName, 
    		Integer createTime, MsgType msgType) {
    	this.toUserName = toUserName;
    	this.fromUserName = fromUserName;
    	this.createTime = createTime;
    	this.msgType = msgType;
	}
    
	public String getToUserName() {
		return toUserName;
	}

	public void setToUserName(String toUserName) {
		this.toUserName = toUserName;
	}

	public String getFromUserName() {
		return fromUserName;
	}

	public void setFromUserName(String fromUserName) {
		this.fromUserName = fromUserName;
	}

	public Integer getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Integer createTime) {
		this.createTime = createTime;
	}

	protected Integer now() {
        return (int)(System.currentTimeMillis() / 1000);
    }

	public MsgType getMsgType() {
		return msgType;
	}

	public void setMsgType(MsgType msgType) {
		this.msgType = msgType;
	}
	
}
